<template>
    <div class="sixin">
        <ul>
          <li v-for="(key,item) in sixin" :key="item" >
            <span class="left">
              <img :src=sixinTwo.data.msgs[item].fromUser.avatarUrl alt="">
            </span>
            <span class="right">
              <p class="p1">
                <span class="p1-left">
                  {{sixinTwo.data.msgs[item].fromUser.nickname}}
                </span>
                <span class="p1-right">10月21日</span>
              </p>
              <p class="p2">
                <span class="p2-left">
                  {{sixin[item].msg}}
                </span>
                <span class="p2-right">
                  <span>
                   {{sixinTwo.data.msgs[item].newMsgCount}}
                  </span>
                </span>
              </p>
            </span>
          </li>

        </ul>
    </div>
</template>

<script>
  import {mapState} from 'vuex';
    export default {
        name: "sixin",
        computed:{
          ...mapState(['sixin','sixinTwo']),
        },

        created(){
          this.$api.getSiXin({limit:30});
          this.$api.getTz({limit:30});
        },
    }
</script>

<style lang="scss">
*{
  margin: 0px;
  padding: 0px;
}
  .sixin{
    ul{
      box-sizing: border-box;
      padding-top: 25px;
      li{
        list-style: none;
        font-size: 0;
        margin-bottom: 20px;
        box-sizing: border-box;
        padding-left: 30px;
        .left{
          display: inline-block;
          width: 165px;
          height: 165px;

          border-radius: 50%;
          vertical-align: middle;
          img{
            width: 165px;
            height: 165px;
            border-radius: 50%;
          }
        }
        .right{
          width: 1050px;

          border-bottom: 1px solid #ccc;
          display: inline-block;
          box-sizing: border-box;
          vertical-align: middle;
          padding-bottom: 30px;
          .p1{
            width: 100%;
            font-size: 0;
            margin-top: 35px;
            box-sizing: border-box;
            padding-right: 30px;
            span{
              vertical-align: middle;
            }
            .p1-left{
              width: 80%;
              font-size: 50px;
              font-weight: bold;
              display: inline-block;
              text-indent: 15px;
            }
            .p1-right{
              width: 20%;
              font-size:25px;
              font-weight: bold;
              color: #969798;
              display: inline-block;
              text-align: right;
            }
          }
          .p2{
            width: 100%;
            font-size: 0;
            margin-top: 15px;
            box-sizing: border-box;
            padding-right: 30px;
            span{
              vertical-align: middle;
            }
            .p2-left{
              width: 80%;
              font-size: 35px;
              color: #969798;
              text-indent: 15px;
              display: inline-block;
              overflow:hidden;
              text-overflow:ellipsis;
              white-space:nowrap
            }
            .p2-right{
              width: 20%;
              display: inline-block;
              text-align: right;

              span{
                display: inline-block;
                font-size: 30px;
                color: white;
                margin-right: 15px;
                box-sizing: border-box;
                font-weight: bold;
                padding: 10px 20px ;
                border-radius: 40px;
                background-color: #c2463a;
              }
            }
          }
        }
      }
    }
  }
</style>
